﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BetFairGlobal;

namespace BetFairProject
{
	class EventsManager	
	{
		private static BFGlobalService global = new BFGlobalService();
		private static GetEventTypesResp EventTypes;
		public static APIRequestHeader header;
		
		public static List<EventType> getAllEventTypes()
		{
			GetEventTypesReq newRequest = new GetEventTypesReq();
			
			List<string> eventTypes = new List<string>();
			GetEventTypesResp response = global.getAllEventTypes(newRequest);
			
			return response.eventTypeItems.ToList();
		}
		
		public static void GetAllEventTypes()
		{
			GetEventTypesReq events = new GetEventTypesReq();
			events.header = header;
			events.locale = "pt";
			EventTypes = global.getAllEventTypes(events);
		}
		public static EventType[] GetFilteredEventsArray(List<int> filter)
		{
			return EventTypes.eventTypeItems.ToList().FindAll(item => filter.Contains(item.id)).ToArray();
		}
		
		public static Event GetCompleteEvent(int eventType)
		{
			
			return new Event(header,eventType);
			
		}
	}
}
